//
//  TKYTProcessCell.m
//  StationHouseHelper
//
//  Created by apple on 2018/6/27.
//  Copyright © 2018年 铁科院. All rights reserved.
//

#import "TKYTProcessCell.h"
#import "TKYPhotoOrVideoView.h"
@interface TKYTProcessCell()

/**
 责任人
 */
//@property (nonatomic, strong)UILabel *personLabel;
/**
 时间
 */
//@property (nonatomic, strong)UILabel *dateLabel;


@end
@implementation TKYTProcessCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        
        [self.contentView addSubview:self.pointImageV];
        [self.contentView addSubview:self.topLineView];
        [self.contentView addSubview:self.lineView];
        [self.contentView addSubview:self.headerView];
        [self.headerView addSubview:self.personLabel];
        [self.headerView addSubview:self.dateLabel];
        
        [self.contentView addSubview:self.describeLabel];
        [self.contentView addSubview:self.showImageView];
        
         [self.showImageView addSubview:self.photoOrVideoView];
        
        [self.pointImageV mas_makeConstraints:^(MASConstraintMaker *make) {
            make.top.equalTo(self.contentView).with.offset(5);
            make.left.equalTo(self.contentView).with.offset(10);
            make.width.mas_equalTo(15);
            make.height.mas_equalTo(15);
        }];
        
        [self.topLineView mas_makeConstraints:^(MASConstraintMaker *make) {
            make.top.equalTo(self.contentView).with.offset(0);
            make.left.equalTo(self.contentView).with.offset(17.5);
            //make.bottom.equalTo(self.contentView).with.offset(0);
            make.width.mas_equalTo(2);
            make.height.mas_equalTo(5);
        }];
        [self.lineView mas_makeConstraints:^(MASConstraintMaker *make) {
            make.top.equalTo(self.pointImageV.mas_bottom).with.offset(0);
            make.left.equalTo(self.contentView).with.offset(17.5);
            make.bottom.equalTo(self.contentView).with.offset(0);
            make.width.mas_equalTo(2);
            //make.height.mas_equalTo(15);
        }];
        [self.headerView mas_makeConstraints:^(MASConstraintMaker *make) {
            make.top.equalTo(self.contentView).with.offset(0);
            make.left.equalTo(self.contentView).with.offset(40);
            make.right.equalTo(self.contentView).with.offset(-20);
            make.height.mas_equalTo(25);
        }];
        
        [self.personLabel mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.equalTo(self.headerView).with.offset(10);
            make.top.equalTo(self.headerView).with.offset(0);
            make.height.mas_equalTo(25);
            make.width.mas_equalTo(150);
        }];
        
        [self.dateLabel mas_makeConstraints:^(MASConstraintMaker *make) {
            make.right.equalTo(self.headerView.mas_right).with.offset(-5);
            make.top.equalTo(self.headerView).with.offset(0);
            make.height.mas_equalTo(25);
            make.width.mas_equalTo(100);
        }];
        
        [self.describeLabel mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.equalTo(self.headerView).with.offset(0);
            make.right.equalTo(self.headerView).offset(-5);
            make.top.equalTo(self.headerView.mas_bottom).with.offset(5);
           // make.bottom.equalTo(self.showImageView.mas_top).with.offset(0);
            //make.height.mas_equalTo(25);

        }];
        
        [self.showImageView mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.equalTo(self.headerView).with.offset(0);
            make.top.equalTo(self.describeLabel.mas_bottom).offset(5);
            make.right.equalTo(self.headerView).with.offset(-5);
            make.bottom.equalTo(self.contentView).offset(-10);
            make.height.mas_equalTo(120);
        }];
        
        [self.photoOrVideoView mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.equalTo(self.showImageView.mas_left).with.offset(0);
            make.top.equalTo(self.showImageView.mas_top).offset(0);
            make.right.equalTo(self.showImageView.mas_right).with.offset(0);
            make.bottom.equalTo(self.showImageView.mas_bottom).offset(-20);
            //make.height.mas_equalTo(100);
        }];
       
    }
    return self;
}

- (UIView *)headerView{
    if (_headerView == nil) {
        _headerView = [[UIView alloc]init];
        _headerView.backgroundColor = kRGBColor(233, 242, 254, 1);
        [_headerView tky_cornerWithRadius:5 borderColor:nil borderWidth:0];
    }
    return _headerView;
}

- (UILabel *)personLabel{
    if (_personLabel == nil) {
        _personLabel = [[UILabel alloc]init];
        _personLabel.text = @"责任人:张某某完成";
        _personLabel.font = Font(12);
    }
    return _personLabel;
}

- (UILabel *)dateLabel{
    if (_dateLabel == nil) {
        _dateLabel = [[UILabel alloc]init];
        _dateLabel.text = @"时间:2018-4-8";
        _dateLabel.font = Font(12);
    }
    return _dateLabel;
}

- (UILabel *)describeLabel{
    if (_describeLabel == nil) {
        _describeLabel = [[UILabel alloc]init];
        _describeLabel.text = @"现场已经整改";
       // _describeLabel.backgroundColor = [UIColor redColor];
        _describeLabel.numberOfLines = 0;
        _describeLabel.font = Font(12);

    }
    return _describeLabel;
}

- (UIView *)showImageView{
    if (_showImageView == nil) {
        _showImageView = [[UIView alloc]init];
        //_showImageView.backgroundColor = [UIColor redColor];
    }
    return _showImageView;
}

- (UIImageView *)pointImageV{
    if (_pointImageV == nil) {
        _pointImageV = [[UIImageView alloc]init];
        _pointImageV.image = [UIImage imageNamed:@"time_btn_gray"];
    }
    return _pointImageV;
}

- (UIView *)lineView{
    if (_lineView == nil) {
        _lineView = [[UIView alloc]init];
        _lineView.backgroundColor = kMainColour;
    }
    return _lineView;
}

- (UIView *)topLineView{
    if (_topLineView == nil) {
        _topLineView = [[UIView alloc]init];
        _topLineView.backgroundColor = kMainColour;
    }
    return _topLineView;
}

- (TKYPhotoOrVideoView *)photoOrVideoView{
    if (_photoOrVideoView == nil) {
        _photoOrVideoView = [[TKYPhotoOrVideoView alloc]init];
    }
    return _photoOrVideoView;
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
